<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>My Engine: Time/Timer.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">My Engine
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">Time/Timer.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef TIMER_H_INCLUDED</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define TIMER_H_INCLUDED</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;StopWatch.h&quot;</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="keyword">namespace </span>my {
<a name="l00007"></a>00007 
<a name="l00021"></a><a class="code" href="classmy_1_1_timer.html">00021</a> <span class="keyword">class </span><a class="code" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023     <span class="keyword">public</span>:
<a name="l00027"></a>00027         <a class="code" href="classmy_1_1_timer.html#adc72cfa80da51da3be9d096f0b7e2194" title="Default Constructor. To use the Timer you will need to use reset(float timeLimit, bool continueRunnin...">Timer</a>();
<a name="l00028"></a>00028 
<a name="l00034"></a>00034         <a class="code" href="classmy_1_1_timer.html#adc72cfa80da51da3be9d096f0b7e2194" title="Default Constructor. To use the Timer you will need to use reset(float timeLimit, bool continueRunnin...">Timer</a>(<span class="keywordtype">float</span> timeLimit, <span class="keywordtype">bool</span> initRunning = <span class="keyword">false</span>);
<a name="l00035"></a>00035 
<a name="l00039"></a>00039         <span class="keyword">virtual</span> <a class="code" href="classmy_1_1_timer.html#ad8a257017aeb9059476afa0c7ac97dc7" title="Default destructor.">~Timer</a>();
<a name="l00040"></a>00040 
<a name="l00045"></a>00045         <span class="keywordtype">float</span>   <a class="code" href="classmy_1_1_timer.html#a5f2c41bea1132f90537a3f6f04c676bc" title="Return the time remaining to reach zero, or zero if the reamining timer is over.">getRemainingTime</a>()      <span class="keyword">const</span>;
<a name="l00046"></a>00046 
<a name="l00051"></a>00051         <span class="keywordtype">bool</span>    <a class="code" href="classmy_1_1_timer.html#a9c18a5bf65b1c71d71732a18da961866" title="Return if the Timer is running or not.">isRunning</a>()             <span class="keyword">const</span>;
<a name="l00052"></a>00052 
<a name="l00057"></a>00057         <span class="keywordtype">bool</span>    <a class="code" href="classmy_1_1_timer.html#a02b0fa5fec771fa982194a7fb00c92f0" title="Return if the Timer is expired or not.">isExpired</a>()             <span class="keyword">const</span>;
<a name="l00058"></a>00058 
<a name="l00062"></a>00062         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_timer.html#a515e829067c5630fcc2d35a36b5bcc48" title="To start the Timer.">start</a>();
<a name="l00063"></a>00063 
<a name="l00067"></a>00067         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_timer.html#a314d9afded21f4cb94339caa36aac992" title="To stop the Timer.">stop</a>();
<a name="l00068"></a>00068 
<a name="l00074"></a>00074         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_timer.html#a89251f4fb94c50022d9ef0ce103716ff" title="To reset the Timer.">reset</a>(<span class="keywordtype">float</span> timeLimit, <span class="keywordtype">bool</span> continueRunning = <span class="keyword">false</span>);
<a name="l00075"></a>00075 
<a name="l00080"></a>00080         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_timer.html#a89251f4fb94c50022d9ef0ce103716ff" title="To reset the Timer.">reset</a>(<span class="keywordtype">bool</span> continueRunning = <span class="keyword">false</span>);
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     <span class="keyword">private</span>:
<a name="l00083"></a>00083         <a class="code" href="classmy_1_1_stop_watch.html" title="Create a stoppable watch, used for timers or to handle time, animations, etc...">StopWatch</a>   _clock;
<a name="l00084"></a>00084         <span class="keywordtype">float</span>       _timeLimit;
<a name="l00085"></a>00085 };
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 } <span class="comment">// namespace</span>
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 <span class="preprocessor">#endif // TIMER_H_INCLUDED</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Nov 18 2011 22:34:34 for My Engine by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
